.SUFFIXES: .c .o

COMPILE = $(CC) $(CFLAGS)
INC_PATH = -I../common -I/usr/local/include
LIB_PATH = -L/usr/local/lib -levent $(LIBS)
TARGET_PATH = $(TARGET_PATH)

COMMON_LIB =
SHARED_OBJS = ../common/hash.o  ../common/chain.o \
              ../common/shared_func.o ../common/ini_file_reader.o \
              ../common/logger.o ../common/sockopt.o \
              ../common/fdfs_base64.o ../common/sched_thread.o \
              ../common/fnio_proto.o ../common/fdht_func.o \
              queue.o func.o global.o client_io.o server_io.o

ALL_OBJS = $(SHARED_OBJS)

ALL_PRGS = fnio_proxy

all: $(ALL_OBJS) $(ALL_PRGS)
.o:
	$(COMPILE) -o $@ $<  $(SHARED_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c:
	$(COMPILE) -o $@ $<  $(ALL_OBJS) $(COMMON_LIB) $(LIB_PATH) $(INC_PATH)
.c.o:
	$(COMPILE) -c -o $@ $<  $(INC_PATH)
install:
	cp -f $(ALL_PRGS) $(TARGET_PATH)
clean:
	rm -f $(ALL_OBJS) $(ALL_PRGS)
